<?php

use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductSortsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('c_product_sorts')) {
            Schema::create('c_product_sorts', function (Blueprint $table) {
                $table->increments('id')->comment('自增ID');
                $table->integer('pid')->comment('父级分类ID');
                $table->string('sort_name')->comment('商品分类名称');
                $table->tinyInteger('sort')->comment('排序字段');
                $table->timestamps();
                $table->comment = '商品分类表';
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('c_product_sorts');
    }
}
